package com.techwells.learningkites.model;

import java.util.List;

import com.techwells.learningkites.base.KitesViewModel;
import com.techwells.learningkites.networkservice.KitesServiceMediator;
import com.techwells.learningkites.networkservice.model.Comment;
import com.techwells.learningkites.networkservice.model.Segment;
import com.techwells.learningkites.networkservice.model.Video;
import com.techwells.learningkites.networkservice.model.VideoAdditional;
import com.techwells.learningkites.networkservice.model.VideoCategory;
import com.techwells.learningkites.networkservice.model.VideoDetail;
import com.techwells.taco.tasktool.TaskToken;

public class VideoDetailViewModel extends KitesViewModel {
	
	public VideoDetail video;
	public VideoAdditional additional;
	public List<Comment> commentList;
	public Comment comment;
	public List<Segment> segmentList;
	public String captcha;
	public int returnCode;
	
	@Override
	public void paddingResult(TaskToken token) {
		// TODO Auto-generated method stub
		super.paddingResult(token);
		
		String method = token.method;
		if (method.equals(KitesServiceMediator.SERVICE_GET_VIDEO_DETAILS)) {
			video = (VideoDetail) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_GET_VIDEO_SEGMENT)) {
			segmentList = (List<Segment>) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_GET_VIDEO_ADDITIONAL)) {
			additional = (VideoAdditional) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_GET_VIDEO_COMMENTS)) {
			commentList = (List<Comment>) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_ADD_VIDEO_COMMENT)) {
			comment = (Comment) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_GET_CAPTCHA)) {
			captcha = (String) response.getResponse();
		}else if (method.equals(KitesServiceMediator.SERVICE_DO_FAVORITE_VIDEO)) {
			returnCode = response.getReturnCode();
		}
	}

}
